﻿using GraphProcessor;
using IQIGame.Onigao.Logic;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay.Editors
{
    [System.Serializable, NodeMenuItem(SkillEditorConst.Battle + "/" + SkillEditorConst.Prefab, typeof(SkillEditorGraph))]
    public class SkillEffectivePrefabNode : BaseNode
    {
        public string key;
        [Output("效果节点")] public SkillEditorActionNode actions;

        public override Color color => Color.white;

        protected override void Process()
        {
            base.Process();
            var rPrefrPab = new SkillEffective_PrefabSource_ConfigData()
            {
                key = this.key,
                prefab = new SkillEffective_Package_ConfigData(),
            };
            this.actions = new SkillEditorActionNode()
            {
                prefabConfig = rPrefrPab,
            };
            SkillEditorBlackboard.Instance.AddPrefab(this.actions.prefabConfig);
        }
    }
}